package com.anycl.design.behavioral.iterator;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Client {
    public static void main(String[] args) {
        Aggregate aggregate = new ConcreteAggregate();
        aggregate.add("Java");
        aggregate.add("C++");
        aggregate.add("Python");

        Iterator iterator = aggregate.createIterator();
        while (iterator.hasNext()) {
            log.info(iterator.next().toString());
        }
    }
}
